Skip to content

[clr-android] Add CoreCLR debugger support for Android#10889

Draft
kotlarmilos wants to merge 2 commits intomainfrom
feature/coreclr-android-debugger
Draft

[clr-android] Add CoreCLR debugger support for Android#10889
kotlarmilos wants to merge 2 commits intomainfrom
feature/coreclr-android-debugger

Conversation

@kotlarmilos
Copy link
Member

@kotlarmilos kotlarmilos commented Mar 5, 2026

Description

When building a CoreCLR Android app in Debug mode, the build now configures the gRPC-based remote debugger. It sets the profiler environment variables CORECLR_ENABLE_PROFILING, CORECLR_PROFILER, CORECLR_PROFILER_PATH so CoreCLR loads libremotemscordbitarget.so as a CoreCLR profiler at startup.

Tested end-to-end on a Pixel 7a arm64 - profiler loads, gRPC connection establishes over adb, initialize return S_OK, and the host receives the CreateProcess callback.

- Introduced targets for setting up and running the CoreCLR remote debugger.
- Added conditions to enable CoreCLR debugging based on project properties.
- Updated environment variables for CoreCLR profiling.
- Implemented tests to verify CoreCLR debugger environment variables and behavior in release builds.
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one thing that is missing is some kind of end-to-end test. Maybe it can't actually debug, but could a test do something like:

  • Build run an app with CoreCLR debugger enabled
  • Verify it launches
  • Use TcpClient or equivalent to just verify the debugger is listening

I think that would catch a lot of potential bugs.

public string? AndroidSequencePointsMode { get; set; }
public bool EnableSGenConcurrent { get; set; }
public string? CustomBundleConfigFile { get; set; }
public bool EnableCoreClrDebugger { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this could check:

  • Is it CoreCLR
  • Is the general purpose debugger MSBuild property set

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to exclude this property and use CoreCLR + general purpose debugger property?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could pass in $(_AndroidRuntime) and the new debugger property, yes.

Thays is about to open a PR similar to this one, you might wait (and/or combine) your changes there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants